/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.pages.class')
        .controller('TeacherCtrl', TeacherCtrl);

    function TeacherCtrl($scope,MemberModel,LoginAccountAuth,AppUtils,$state) {

        var vm = this;
        vm.items = [];
        vm.pageIndex = 1;
        vm.loadMoreBtnStatus = true;
        vm.loadMoreBtnStr = "加载更多";
        vm.loginAccount = {};
        vm.teacherInfo = {};
        LoginAccountAuth.getAccount().then(function(data){
            vm.loginAccount = data;
            MemberModel.getMemberInfo({id:data.memberId}).$promise.then(function(response){
                if(!AppUtils.isUndefinedOrNull(response.memberInfo)){
                    vm.teacherInfo = response.memberInfo;
                }else {
                    AppUtils.showTipsTop("未查询到教师信息！");
                }
            })
        })
        $scope.editMemberInfo = function(){
            $state.go("memberMenu.edit");
        }
    }
})();
